package com.example.controller;

import com.example.pojo.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/examples")
public class UserController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping(value ="/{id}",method = RequestMethod.GET)
    public User queryUserById(@PathVariable(value = "id")Long id){
        return userService.queryUserById(id);
    }
}
